package com.zhongxi.guoyuan.view.seller;

import android.view.View;
import android.widget.RelativeLayout;

import com.zhongxi.guoyuan.R;
import com.zhongxi.guoyuan.application.MyApplication;
import com.zhongxi.guoyuan.base.BaseActivity;

public class SellerCenterActivity extends BaseActivity implements View.OnClickListener {

    private RelativeLayout relaCoin;
    private RelativeLayout relaRewardCoin;
    private RelativeLayout relaBeautifulStore;
    private RelativeLayout relaAllCenter;

    @Override
    protected void initView() {
        super.initView();
        setContentView(R.layout.activity_seller_center);
        initTitle();
        tvTitle.setText("商家中心");
        relaAllCenter = (RelativeLayout) findViewById(R.id.relaAllCenter);
        relaBeautifulStore = (RelativeLayout) findViewById(R.id.relaBeautifulStore);
        relaRewardCoin = (RelativeLayout) findViewById(R.id.relaRewardCoin);
        relaCoin = (RelativeLayout) findViewById(R.id.relaCoin);
    }

    @Override
    protected void initData() {
        super.initData();
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        ivBack.setOnClickListener(this);
        relaAllCenter.setOnClickListener(this);
        relaBeautifulStore.setOnClickListener(this);
        relaRewardCoin.setOnClickListener(this);
        relaCoin.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.ivBack:
                finish();
                break;
            case R.id.relaAllCenter:
                if(null!=MyApplication.getInstance().getCredentials()&&!"".equals(MyApplication.getInstance().getCredentials())){
                    startAct(SellerManagerOrderActivity.class);
                }else{
                    startAct(SellerManagerLoginActivity.class);
                }
                break;
            case R.id.relaBeautifulStore:
                if(null!= MyApplication.getInstance().getBeautifulCredentials()&&!"".equals(MyApplication.getInstance().getBeautifulCredentials())){
                    startAct(SellerBeautifulStoreOrderActivity.class);
                }else{
                    startAct(SellerBeautifulStoreLoginActivity.class);
                }
                break;
            case R.id.relaRewardCoin:
                if(null!=MyApplication.getInstance().getRewardCoinCredentials()&&!"".equals(MyApplication.getInstance().getRewardCoinCredentials())){
                    startAct(SellerRewardCoinActivity.class);
                }else{
                    startAct(SellerRewardLoginActivity.class);
                }
                break;
            case R.id.relaCoin:
                if(null!=MyApplication.getInstance().getCoinCredentials()&&!"".equals(MyApplication.getInstance().getCoinCredentials())){
                    startAct(SellerCoinStoreOrderActivity.class);
                }else{
                    startAct(SellerCoinStoreLoginActivity.class);
                }
                break;
        }
    }
}
